<template>
    <div class="loading" v-show="status !== 'pass'">
        <div v-show="status === 'loading'">
            <div class="circle circle-1"></div>
            <div class="circle circle-2"></div>
            <div class="circle circle-3"></div>
            <div class="circle circle-4"></div>
            <div class="circle circle-5"></div>
        </div>
        <div class="error" v-show="status === 'error'">
            <p class="xx-big">加载失败 <(。_。)></p>
            <Button type="primary" icon="refresh" @click="onRefresh">重试</Button>
        </div>
        <div class="empty" v-show="status === 'empty'">
            <p class="xx-big">空空如也 (￣▽￣)"</p>
            <p>
                <slot name="empty"></slot>
            </p>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'Loader',
        props: {
            status: {
                type: String,
                default: 'pass'
            }
        },
        methods: {
            onRefresh() {
                this.$emit('refresh');
            }
        }
    }   
</script>
